const formatTime = (date) => {
  console.log(date, "@@@");
  const year = date.getFullYear();
  const month = date.getMonth() + 1;
  const day = date.getDate();
  const hour = date.getHours();
  const minute = date.getMinutes();
  const second = date.getSeconds();

  let str1 = [year, month, day]
    .map((item) => {
      return item.toString().padStart(2, "0");
    })
    .join("-");

  let str2 = [hour, minute, second]
    .map((item) => {
      return item.toString().padStart(2, "0");
    })
    .join(":");

  return str1 + " "+str2;
};

const formatNumber = (n) => {
  n = n.toString();
  return n[1] ? n : `0${n}`;
};

module.exports = {
  formatTime,
};
